package com.bush.mall.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bush.mall.common.annotation.ListValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * 品牌 实体类
 * @author RUN
 * @date 2022-11-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="品牌实体类", description="品牌")
@TableName("pms_brand")
public class BrandEntity implements Serializable {

	private static final long serialVersionUID = 1L;

	@TableId
	@ApiModelProperty(value = "品牌id")
	private Long brandId;

	@ApiModelProperty(value = "品牌名")
	@NotBlank(message = "品牌名字段不能为空")
	private String name;

	@ApiModelProperty(value = "品牌logo地址")
	@URL(message = "品牌logo必须是个url地址")
	private String logo;

	@ApiModelProperty(value = "介绍")
	private String descript;

	@ApiModelProperty(value = "显示状态[0-不显示；1-显示]")
	@NotNull(message = "显示状态字段不能为空")
	@ListValue(value = {0,1})
	private Integer showStatus;

	@ApiModelProperty(value = "检索首字母")
	@Pattern(regexp = "^[a-zA-Z]$",message = "检索首字母必须是以字母a-z 或者 A-Z 中得字母")
	@NotBlank(message = "检索首字母字段不能为空")
	private String firstLetter;

	@ApiModelProperty(value = "排序")
	@Min(value = 0,message = "排序必须是大于0的整数")
	@NotNull(message = "排序字段不能为空")
	private Integer sort;

}
